<template>
  <div class="item-detail">
    <div class="detail-title">{{ form.title }}</div>
    <div class="detail-i">
      <div v-if="!form.editStatus">{{ form.value }}</div>
      <el-input v-else v-model="form.inputValue" maxlength="12" :placeholder="form.placeholder" clearable style="width:100%;border:none;"></el-input>
      <div v-if="form.allowEdit" class="edit" @click="changeStatus">{{ form.content }} <i v-if="form.loading" class="el-icon-loading"></i></div>
    </div>
  </div>
</template>

<script>
export default {
  props:{
    form:{
      type:Object,
      default:()=>{}
    }
  },

  methods:{
    changeStatus(){
      this.$emit('changeStatus',this.form)
    }
  }
}
</script>

<style scoped lang="scss">
.item-detail{
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  .detail-title{
    width: 60px;
    margin-right: 20px;
  }
  .detail-i{
    flex:1;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    line-height: 50px;
    border-bottom: 1px solid rgb(229,230,235);

  }
  .edit{
    width: 80px;
    color: rgb(22,93,255);
    cursor: pointer;
    text-align: right;
  }
}
</style>

